package br.com.jamulateste;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class JamulaTeste2Activity extends Activity {
    /** Called when the activity is first created. */
	
    EditText ednum1;
    EditText ednum2;
    EditText resultado;
    Button calcular;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
                
        setContentView(R.layout.main);
                        
//        TextView qualquer = new TextView(this);
//        qualquer.setText("Isto é Trivial!");
//        setContentView(qualquer);


    }
    
    public void cricar(View view)
    {
        ednum1 = (EditText) findViewById(R.campo.num1);
        ednum2 = (EditText) findViewById(R.campo.num2);
        resultado = (EditText) findViewById(R.campo.num3);
        
        int valor1 = Integer.parseInt(ednum1.getText().toString());
        int valor2 = Integer.parseInt(ednum2.getText().toString());
        int result =valor1+valor2;
        
        calcular = (Button) findViewById(R.campo.calcular);
        
        resultado.setText(String.valueOf(result));
    }
}